package com.viphuli.fragment;

import butterknife.OnClick;

import com.loopj.android.http.RequestParams;
import com.viphuli.app.R;
import com.viphuli.common.AccessTokenKeeper;
import com.viphuli.http.ApiRequest;

public class AccountNurseJoinReadyFragment extends BaseProgressFragment {

	@Override
	protected int obtainContentRes() {
		return R.layout.frag_account_nurse_join_ready;
	}

	@Override
	protected void initParams() {
	}

	@Override
	protected void initView() {

	}

	@Override
	protected void initData() {

	}

	@OnClick(R.id.id_account_nurse_join_btn)
	public void nurseJoin() {

		AccessTokenKeeper tokenKeeper = AccessTokenKeeper.readAccessToken(getActivity());

		if (tokenKeeper.isLogin()) {

			//网络请求
			RequestParams params = new RequestParams();
			params.put("uid", tokenKeeper.getOpenId());
			ApiRequest.accountNurseJoinReady.request(this, params, false);

		} else {
			AccountLoginFragment.goWithConfirmResult(getActivity(), getString(R.string.tip_need_login));
		}

	}

	@OnClick(R.id.id_account_nurse_join_right_btn)
	public void nurseRight() {
		ApiRequest.accountUserJoinInfoAgreement.request(getActivity());
	}

}
